<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <!--要求当前网页使用IE浏览器最高版本的内核来渲染-->
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!--视口的设置：视口的宽度和设备一致，默认的缩放比例和PC端一致，用户不能自行缩放-->
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <!--[if lt IE 9]>
  <!--解决ie9以下浏览器对html5新增标签的不识别，并导致CSS不起作用的问题-->
    <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <!--解决ie9以下浏览器对 css3 Media Query 的不识别 -->
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
  
  <link rel="stylesheet" href="../bootstrap/css/bootstrap.min.css">
  <link rel="stylesheet" href="../css/base.css">
  <link rel="stylesheet" href="../css/token.css">
  <link rel="stylesheet" href="../css/uploadImg.css">
  <link rel="stylesheet" href="../css/bootstrapValidator.min.css">
  <title>提交Token</title>
</head>
<body>
  <!--header-->
  <header>
    <div class="navbar-default" >
      <div class="container">
        <div class="logo">
          <button type="button" id="navbar-btn" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
            <div class="three-icon-bar">
              <span class="icon-bar"> </span>
              <span class="icon-bar"> </span>
              <span class="icon-bar"> </span>
            </div>
            <div class="three-icon-delete" style="display: none;min-height: 38px;line-height: 38px;">
              <span class="glyphicon glyphicon-remove" style="width: 30px;text-align: center; font-size: 16px;"></span>
            </div>
          </button>
          <h1>
            <a href="index.html"><img src="../image/logo@2x.png"></a>
          </h1>
        </div>
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
          <ul class="navbar-nav">
            <li><a href="../index.html"><span class="isCh">首页</span><span class="isEn">Home</span></a></li>
            <li><a href="../html/bigHistory.html"><span class="isCh">大事记</span><span class="isEn">History</span></a></li>
            <li style="position: relative;">
              <a href="##" data-toggle="dropdown" class="dropdown-toggle"><span class="isCh">资源</span><span class="isEn">Explorer</span><span class="iconfont icon-jiantoushang" style="font-weight: 600; padding-left: 4px;"></a>
                <ul class="dropdown-menu">
                  <li><a href="https://github.com/ChainWalletGroup/cha-contract">Github</a></li>
                </ul>
            </li>
            <li style="position: relative;">
              <a href="##" data-toggle="dropdown" class="dropdown-toggle active-now"><span class="isCh">提交项目</span><span class="isEn">Submit</span><span class="iconfont icon-jiantoushang" style="font-weight: 600; padding-left: 4px;"></a>
                <ul class="dropdown-menu">
                  <li><a href="../html/dappHosting.html"><span class="isCh">提交DApp</span><span class="isEn">Submit DApp</span></a></li>
                  <li><a href="../html/tokenHosting.html"><span class="isCh">提交Token</span><span class="isEn">Submit Token</span></a></li>
                </ul>
            </li>
            <li style="position: relative;">
              <a href="##" data-toggle="dropdown" class="dropdown-toggle"><span class="isCh">帮助中心</span><span class="isEn">Help</span><span class="iconfont icon-jiantoushang" style="font-weight: 600; padding-left: 4px;"></a>
                <ul class="dropdown-menu">
                  <li><a href="https://docs.chainwallet.me/"><span class="isCh">介绍</span><span class="isEn">recommend</span></a></li>
                  <li><a href="https://docs.chainwallet.me/shi-yong-jiao-cheng/"><span class="isCh">教程</span><span class="isEn">Tutorial</span></a></li>
                  <li><a href="https://docs.chainwallet.me/huo-dong/duo-lian-qian-bao"><span class="isCh">问答</span><span class="isEn">Questions</span></a></li>
                </ul>
            </li>
            <li style="position: relative;" class="visible-xs-block">
              <a href="##" data-toggle="dropdown" class="dropdown-toggle">
                <span class="isCh">语言</span>
                <span class="isEn">language</span>                 
                <span class="iconfont icon-jiantoushang" style="font-weight: 600; padding-left: 4px;"></a>
                <ul class="dropdown-menu">
                  <li class="ch-lang">简体中文</li>
                  <li class="en-lang">English</li>
                </ul>
              </li>
          </ul>
          <div class="clearfix"> </div>
        </div>
        
      </div>
      <div class="clearfix"> </div>
    </div>
  </header>
  <!-- 内容区域 -->
    <div class="container top-bug">
      <div style="padding: 15px;">
        <div class="token-banner">
          <img src="../image/tokenbanner.png" alt="token背景">
      </div>
        <div class="row">
          <!-- 表单区域 -->
        <form role="form" class="tokenForm" action="" method="post" id="token-form" role="form">
          <div class="form-group col-sm-5 ">
            <label for="name">
              <span class="isCh">代币名称</span>
              <span class="isEn">Tokens Name</span>
            </label>
            <input type="text" class="form-control" name="daibimingcheng" autocomplete="off" >
          </div>
          <div class="form-group col-sm-5 col-sm-offset-2">
            <label for="name">
              <span class="isCh">官方网址</span>
              <span class="isEn">Official Website</span>           
            </label>
            <input type="text" class="form-control" name="guanfangwangzhi" autocomplete="off" >
          </div>
           <div class="form-group col-sm-5">
            <label for="name">
              <span class="isCh">部署公链</span>
              <span class="isEn">Deployment Of Public Chain</span>
            </label>
            <input type="text" class="form-control isCh" placeholder="例如：ETH" name="bushugonglian" autocomplete="off" >
            <input type="text" class="form-control isEn" placeholder="such as：ETH" name="bushugonglian" autocomplete="off" >
          </div> 

          <div class="form-group col-sm-5  col-sm-offset-2">
            <label for="name">
              <span class="isCh">代币合约</span>
              <span class="isEn">Tokens Contracts</span>
            </label>
            <input type="text" class="form-control" name="daibiheyue" autocomplete="off">
          </div>

          <div class="form-group col-sm-5  ">
            <label for="name">
              <span class="isCh">代币精度</span>
              <span class="isEn">Precision Of Tokens</span>
            </label>
            <input type="text" class="form-control isCh" placeholder="例如：ETH" name="daibijingdu" autocomplete="off">
            <input type="text" class="form-control isEn" placeholder="such as" name="daibijingdu" autocomplete="off">
          </div>
          <div class="form-group col-sm-5  col-sm-offset-2">
            <label for="name">
              <span class="isCh">发行总量</span>
              <span class="isEn">Total Circulation</span>           
            </label>
            <input type="text" class="form-control" name="faxingzongliang" autocomplete="off">
          </div>
 
          <div class="form-group col-sm-5  ">
            <label for="name">
              <span class="isCh">项目简介</span>
              <span class="isEn">Project Brief</span> 
            </label>
            <textarea class="form-control myform-area isCh" placeholder="例如：一句话简单介绍该项目" name="xiangmujianjie"></textarea>
            <textarea class="form-control myform-area isEn" placeholder="For example: A brief description of the project" name="xiangmujianjie"></textarea>
          </div>
          <div class="form-group col-sm-5  col-sm-offset-2">
            <label for="name">
              <span class="isCh">代币 Logo</span>
              <span class="isEn">Tokens Logo</span>
              <span class="label-info-text" style="padding-left: 8px;">
                <span class="isCh"> (图片尺寸：200*200px，支持jpg,png图片格式)</span>
                <span class="isEn">(Picture size：200*200px support jpg png Picture format)</span>
              </span>
            </label>
              <div class="upload-content">
                  <div class="content-img">
                      <ul class="content-img-list"></ul>
                      <div class="file">            
                          <img src="../image/imgUpload.png" alt="图片上传">    
                          <span class="file-info">
                            <span class="isCh">点击选择图片 （需小于500kb）</span>
                            <span class="isEn">Click to select Picture</span>
                          </span>         
                          <input type="file" name="file" accept="image/*" id="upload" multiple>
                      </div>
                      <small class="help-block file-is-have"  style="color: #a94442;">
                        <span class="isCh">请选择上传图片</span>
                        <span class="isEn">Please select an image to upload</span>
                      </small>
                  </div>
                  <!-- <div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
                      <div class="modal-dialog modal-lg" role="document">
                          <div class="modal-content">
                          </div>
                      </div>
                  </div> -->
              </div>
          </div>
          <div class="form-group col-sm-5  ">
            <label for="name">
              <span class="isCh">邮箱</span>
              <span class="isEn">Email</span>
            </label>
            <input type="text" class="form-control" name="youxiang" autocomplete="off">
          </div>
          <div class="form-group col-sm-5  col-sm-offset-2">
            <label for="name">Twitter</label>
            <input type="text" class="form-control" name="tuite" autocomplete="off">
          </div>
          <div class="form-group col-sm-5  ">
            <label for="name">
              <span class="isCh">微信</span>
              <span class="isEn">WeChat</span>
            </label>
            <input type="text" class="form-control" name="weixin" autocomplete="off">
          </div>
          <div class="form-group col-sm-5  col-sm-offset-2">
            <label for="name">
              <span class="isCh">审计报告链接</span>
              <span class="isEn">Audit Report Link</span>
            </label>
            <input type="text" class="form-control isCh" placeholder="如：http://55.com" name="shenjibaogao" autocomplete="off">
            <input type="text" class="form-control isEn" placeholder="such as：http://55.com" name="shenjibaogao" autocomplete="off">
          </div>
          <div class="form-group col-sm-5  ">
            <label for="name">
              <span class="isCh">联系电话</span>
              <span class="isEn">TEL</span>
              <span class="label-info-text" style="padding-left: 8px;">
                <span class="isCh">(请务必留下除邮箱以外的客服联系方式，否则无法通过审核)</span>
                <span class="isEn">Please leave your customer service contact information except email</span>
              </span>
            </label>
            <input type="text" class="form-control" name="lianxidianhua" autocomplete="off">
          </div>
          <div class="form-group col-sm-5  col-sm-offset-2">
            <label class="beforeNone" for="name">
              <span class="isCh">其他</span>
              <span class="isEn">More</span>
            </label>
            <input type="text" class="form-control" autocomplete="off">
          </div> 

        </form>
        <div class="row" style="margin: 0;">
          <div class="introduce-btn-box form-group col-sm-5  col-sm-offset-7">
            <button type="submit" id="introduceBtn" class="introduce-btn">
              <span class="isCh">提交</span>
              <span class="isEn">Submit</span>
            </button>
          </div>
        </div> 
      </div>
		</div>	

    <!-- 要求区域 -->
    <div class="dappRequests">
          <div class="request-title">
            <h4>
              <span class="isCh">Token 要求</span>
              <span class="isEn">Token Request</span> 
            </h4>
          </div>
          <div class="dappRequestsBody">
            <ul>
              <li>
                <p>&nbsp;
                  <span class="isCh">项目方提供的网址可公开访问且稳定性有保证</span>
                  <span class="isEn">The website provided by the project party is publicly accessible and its stability is guaranteed</span>
              </p>
            </li>
              <li><p>&nbsp;
                <span class="isCh">智能合约已部署到主网上，敏感逻辑处需开源</span>
                <span class="isEn">The smart contract has been deployed to the main network, and the sensitive logic needs to be open sourcee</span>
              </p>
            </li>
              <li><p>&nbsp;
                <span class="isCh">敏感的合约需提供第三方安全机构的审计报告</span>
                <span class="isEn">Sensitive contracts require audit reports from third-party security agencies</span>
              </p>
            </li>
              <li><p>&nbsp;
                <span class="isCh">交互逻辑清晰，有实际用途，且已适配移动端</span>
                <span class="isEn">The interaction logic is clear, has practical use, and has been adapted to mobile terminal</span>
              </p>
            </li>
              <li><p>&nbsp;
                <span class="isCh">符合相关法律法规，不存在欺诈和侵权等行为</span>
                <span class="isEn">In accordance with relevant laws and regulations, there is no fraud, infringement and other acts</span>             
              </p>
            </li>
              <li><p>&nbsp;
                <span class="isCh">如违反相关法律法规，自愿承受相应法律责任</span>
                <span class="isEn">In case of violation of relevant laws and regulations, voluntarily bear the corresponding legal liability</span>
              </p>
            </li>
            </ul>
          </div>
    </div>
        <!-- 联系我们 -->
    <div class="contentUs">
          <h4>
            <span class="isCh">联系我们</span>
            <span class="isEn">Contact US</span>
          </h4>
          <p>Email: <a href="mailto:https://bd@chainwallet.me"><span style="color:#00DFC0;">bd@chainwallet.me</span></a></p>
    </div>
    </div>
    <!-- 底部区域 -->
    <div class="footer container">
      <div class="mod_service">
          <div class="clearfix">
            <!-- 移动设备下 隐藏 -->
          <div class="brand-copy col-sm-3 hidden-xs">
            <div class="copy-logo">
              <img src="../image/copy-logo.png" alt="">
            </div>
            <span class="copy-time">@&nbsp;2021</span>
            <div>
              <div class="dropdown">
                <button type="button" class="btn dropdown-toggle language-dropdown" id="dropdownMenu1" data-toggle="dropdown"><span style="padding-right: 8px;" class="lang-show">简体中文</span>
                  <img src="../image/diqiu.png" alt="">
                  <span class="caret"></span>
                </button>
                <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
                    <li role="presentation">
                        <a role="menuitem" tabindex="-1" href="#" class="ch-lang">
                          简体中文
                        </a>
                    </li>
                    <li role="presentation">
                        <a role="menuitem" tabindex="-1" href="#" class="en-lang">
                          English
                        </a>
                    </li>
                </ul>
            </div>
            </div>
          </div>
          <div class="brand-copy col-xs-12 col-sm-3">
            <div class="copy-title">
              <span class="isCh">项目合作</span>
              <span class="isEn">Project Cooperation</span>   
            </div>
            <div class="row">
            <ul>
              <li class="col-xs-6 col-sm-12">
                <a href="#">
                  <span class="isCh">提交DApp</span>
                  <span class="isEn">Submit DApp</span>
              </a>
            </li>
              <li class="col-xs-6 col-sm-12">
                <a href="#">
                  <span class="isCh">提交Token</span>
                  <span class="isEn">Submit Token</span>
              </a>
            </li>
              <li class="col-xs-6 col-sm-12">
                <a href="mailto:https://partner@chainwallet.me">
                  partner@chainwallet.me
                </a>
                </li>              
            </ul>
          </div>
          </div>
          
          <div class="brand-copy col-xs-12 col-sm-3">
            <div class="copy-title">
              <span class="isCh">用户支持</span>
              <span class="isEn">User Support</span>
            </div>
            <div class="row">
            <ul>
              <li class="col-xs-6 col-sm-12"><a href="https://docs.chainwallet.me/">
                <span class="isCh">帮助中心</span>
                <span class="isEn">Help Center</span>                  
              </a>
            </li>
              <li class="col-xs-6 col-sm-12">
                <a href="https://docs.chainwallet.me/huo-dong/duo-lian-qian-bao">
                  <span class="isCh">热门问答</span>
                  <span class="isEn">Popular Answers</span>                   
                </a>
              </li>
              <li class="col-xs-6 col-sm-12">
                <a href="#">
                  <span class="isCh">隐私协议</span>
                  <span class="isEn">Privacy Agreement</span>
                </a>
              </li>
              <li class="col-xs-6 col-sm-12">
                <a href="#">
                  <span class="isCh">服务协议</span>
                  <span class="isEn">Service Agreement</span>
                </a>
              </li>
            </ul>
          </div>
          </div>
          <!-- 移动设备以上显示 -->
          <div class="brand-copy col-sm-3 col-md-3 hidden-xs col-xs-12">
            <div class="copy-title">
              <span class="isCh">联系我们</span>
              <span class="isEn">Contact Us</span>
              
            </div>
            <div style="text-align: center;">
              <span class="copy-items isShowEr">
                <img src="../image/wechat.png" alt="微信">
                <img src="../image/weChatMd.png" id="weChatShow" alt="微信二维码">
              </span>
              <span class="copy-items"><a href="https://t.me/CHA_Wallet"><img src="../image/telegram.png" alt="telegram"></a></span>
              <span class="copy-items"><a href="https://twitter.com/Chain__Wallet"><img src="../image/Twitter.png" alt="推特"></a></span>
              <span class="copy-items"><a href="https://weibo.com/u/7613046674"><img src="../image/weibo.png" alt="微博"></a></span>
            </div>
          </div>
          
        <div class="brand-copy col-xs-12 col-sm-3 col-md-3 visible-xs-block">
          <div class="copy-title">
            <span class="isCh">友情链接</span>
            <span class="isEn">Blogroll</span>     
          </div>
          <div class="row">
          <ul>            
            <li class="col-xs-6 col-sm-12"><a href="https://www.oklink.com/">
              <span class="isCh">欧科云链</span>
              <span class="isEn">OK Link</span>
            </a>
          </li>
            <li class="col-xs-6 col-sm-12"><a href="https://www.ouyi.cc/okexchain">OK ExChain</a></li>
            <li class="col-xs-6 col-sm-12"><a href="https://www.binance.org/">Binance Chain</a></li>
            <li class="col-xs-6 col-sm-12"><a href="https://www.hecochain.com/">Huobi ECO Chain</a></li>
          </ul>
        </div>
        </div>
  
        <!-- 平板以下 -->
        <div class="brand-copy  col-sm-3 col-md-3 visible-xs-block col-xs-12">
          <div class="copy-title">
            <span class="isCh">联系我们</span>
            <span class="isEn">Contact Us</span>
          </div>
          <div class="mdLink">
            <span class="copy-items"><img src="../image/wechat@3x@2x.png" alt="微信"></span>
            <span class="copy-items"><a href="https://t.me/CHA_Wallet"><img src="../image/telegram.292c0aa1@2x.png" alt="telegram"></a></span>
            <span class="copy-items"><a href="https://twitter.com/Chain__Wallet"><img src="../image/twitter.056aae56@2x.png" alt="推特"></a></span>
            <span class="copy-items"><a href="https://weibo.com/u/7613046674"><img src="../image/weibo.ffd7462c@2x.png" alt="微博"></a></span>
          </div>
        </div>
      </div>
  
        <!-- 非手机显示区域 --> 
        <div class="mod_copyright hidden-xs">
          <div class="link">
              <a href="javascript:;">
                <span class="isCh">友情链接</span>
                <span class="isEn">Blogroll</span>
              </a>
              <a href="https://www.oklink.com/">
                <span class="isCh">欧科云链</span>
                <span class="isEn">OkLink</span>
               
              </a>
              <a href="https://www.ouyi.cc/okexchain">OKExChain</a>
              <a href="https://www.binance.org/">Binance Chain</a>
              <a href="https://www.hecochain.com/">Huobi ECO Chain</a>
          </div>
        </div>
        <div style="text-align: center;">
          <div class="copyright">
            Copyright © 2021 Chain Wallet
          </div>
         Singapore Catalina Foundation Ltd.All rights reserved
        </div>
      </div>
  </div>
  <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
  <script src="../js/bootstrapValidator.min.js"></script>
  <script src="../js/base.js"></script>
  <script>
    $(function () {
        // 鼠标经过显示删除按钮
        $(".content-img-list").on("mouseover", ".content-img-list-item", function() {
            $(this).children("div").removeClass("hide")
        })
            // 鼠标离开隐藏删除按钮
        $(".content-img-list").on(
                "mouseleave",
                ".content-img-list-item",
                function() {
                    $(this).children("div").addClass("hide")
                }
            )
            // 单个图片删除
        $(".content-img-list").on(
            "click",
            ".content-img-list-item a .icon-lajitong",
            function() {
                var index = $(this).parent().parent().parent().index()
                imgSrc.splice(index, 1)
                imgFile.splice(index, 1)
                imgName.splice(index, 1)
                var boxId = ".content-img-list"
                addNewContent(boxId)
                if (imgSrc.length < 4) {
                    //显示上传按钮
                    $(".content-img .file").show()
                }
            }
        )

        $(".content-img-list").on(
            "click",
            ".content-img-list-item a .icon-lajitong",
            function() {
                var index = $(this).parent().parent().parent().index()
                $(".modal-content").html("")

                var bigimg = $(".modal-content").html()
                $(".modal-content").html(
                    bigimg +
                    '<div class="show"><img src="' +
                    imgSrc[index] +
                    '" alt=""><div>'
                )
            }
        )

      $(".file-is-have").css("display", "none")

      $("#token-form").bootstrapValidator({
        live: 'disabled', //验证时机，enabled是内容有变化就验证（默认），disabled和submitted是提交再验证
        excluded: [':disabled', ':hidden', ':not(:visible)'], //排除无需验证的控件，比如被禁用的或者被隐藏的
        //submitButtons: '#introduceBtn', //指定提交按钮，如果验证失败则变成disabled，但我没试成功，反而加了这句话非submit按钮也会提交到action指定页面
        // feedbackIcons: {//根据验证结果显示的各种图标
        //   valid: 'glyphicon glyphicon-ok',
        //   invalid: 'glyphicon glyphicon-remove',
        //   validating: 'glyphicon glyphicon-refresh'
        // },
        fields: {
            daibimingcheng: {
                validators: {
                    notEmpty: {
                        message:`<span class="isCh">请输入代币名称</span>
                                 <span class="isEn">Please enter a token name</span>`
                    }
                }
            },
            guanfangwangzhi: {
                validators: {
                    notEmpty: {
                        message:`<span class="isCh">请输入官网网址</span>
                                 <span class="isEn">Please enter the official website address</span>`
                    }
                }
            },
            bushugonglian: {
                validators: {
                    notEmpty: {
                         //message: ''
                         message:`<span class="isCh">请输入部署公链</span>
                                 <span class="isEn">Please enter the deployment public chain</span>`
                    }
                }
            },
            daibiheyue: {
                validators: {
                    notEmpty: {
                       //  message: ''
                       message:`<span class="isCh">请输入代币合约</span>
                                 <span class="isEn">Please enter the token contract</span>`
                    }
                }
            },
            daibijingdu: {
                validators: {
                    notEmpty: {
                        // message: ''
                        message:`<span class="isCh">请输入代币精度</span>
                                 <span class="isEn">Please enter the token accuracy</span>`
                    }
                }
            },
            faxingzongliang: {
                validators: {
                    notEmpty: {
                        // message: ''
                        message:`<span class="isCh">请输入发行总量</span>
                                 <span class="isEn">Please enter the total number of releases</span>`
                    }
                }
            },
            xiangmujianjie: {
                validators: {
                    notEmpty: {
                       //  message: ''
                       message:`<span class="isCh">请输入项目简介</span>
                                 <span class="isEn">Please enter project description</span>`
                    }
                }
            },
            youxiang: {
                validators: {
                    notEmpty: {
                        // message: ''
                        message:`<span class="isCh">请输入邮箱</span>
                                 <span class="isEn">Please enter your email address</span>`
                    }
                }
            },
            tuite: {
                validators: {
                    notEmpty: {
                       //  message: ''
                       message:`<span class="isCh">请输入推特</span>
                                 <span class="isEn">Please Enter Twitter</span>`
                    }
                }
            },
            weixin: {
                validators: {
                    notEmpty: {
                        // message: ''
                        message:`<span class="isCh">请输入微信</span>
                                 <span class="isEn">Please Enter Wechat</span>`
                    }
                }
            },
            shenjibaogao: {
                validators: {
                    notEmpty: {
                        // message: ''
                        message:`<span class="isCh">请输入审计报告</span>
                                 <span class="isEn">Please enter the audit report</span>`
                    }
                }
            },
            lianxidianhua: {
                validators: {
                    notEmpty: {
                        // message: ''
                        message:`<span class="isCh">请输入联系电话</span>
                                 <span class="isEn">Please enter your phone number</span>`
                    }
                }
            }
        }
        });
        let langLan = sessionStorage.getItem("lang")
        if(!langLan || langLan == "ch") {
         $(".ch-lang").click()
        } else {
          $(".en-lang").click()
        }
      });
      
      var imgFile = [] //文件流
      var imgSrc = [] //图片路径
      var imgName = [] //图片名字
      $("#introduceBtn").click(function () {//非submit按钮点击后进行验证，如果是submit则无需此句直接验证 
        
        $("#token-form").bootstrapValidator('validate');//提交验证
        let imgLength = $(".content-img").find(".content-img-list-item").length
        if (imgLength <= 0) {
          return $(".file-is-have").css("display", "block")
        } else {
         $(".file-is-have").css("display", "none")
        }
        if ($("#token-form").data('bootstrapValidator').isValid()) {//获取验证结果，如果成功，执行下面代码
          
          let data = ($('#token-form').serializeArray()); // 通过序列化表单值来创建对象数组（名称和值）
          let trans = {
            serialize: function (obj) {
              var o = {};
              $.each(obj, function () {
                if (o[this.name]) {
                  if (!o[this.name].push) {
                    o[this.name] = [o[this.name]];
                  }
                  o[this.name].push(this.value || "");
                } else {
                  o[this.name] = this.value || "";
                }
              });
              return o;
            }
          }
          // 转换成对象形式
        let newData = trans.serialize(data)
         // FormData上传图片
        var formFile = new FormData()
        // formFile.append("type", type);
        // formFile.append("newData", newData);
        // 遍历图片imgFile添加到formFile里面
    $.each(imgFile, function(i, file) {
        formFile.append("myFile[]", file)
    })
    newData.imgList = formFile
    console.log(newData)

    // $.ajax({
    //     url: '',
    //     type: 'POST',
    //     data: formFile,
    //     async: true,
    //     cache: false,
    //     contentType: false,
    //     processData: false,
    //     // traditional:true,
    //     dataType: 'json',
    //     success: function (res) {
    //         console.log(res);
    //         if (res.code == 0) {
    //             alert("已提交")
    //             //  $("#adviceContent").val("");
    //             // $("#contact").val("");
    //         } else {
    //             alert(res.message);
    //             $('.content-img .file').show();
    //             $("#adviceContent").val("");
    //             $("#cotentLength").text("0/240");
    //             $("#contact").val("");
    //             imgSrc = []; imgFile = []; imgName = [];
    //             addNewContent(".content-img-list");
    //         }
    //     }
    // });
        //  }
         }
      });


//图片上传
$("#upload").on("change", function(e) {
    if (
        $(".content-img").find(".content-img-list-item").length > 0 ||
        $(".file-is-have").css("display") == "block"
    ) {
        $(".file-is-have").css("display", "none")
    }
    var imgSize = this.files[0].size
    if (imgSize > 1024 * 500 * 1) {
        //1M
        this.value = ""
        return alert("上传图片不能超过500KB")
    }

    if (
        this.files[0].type != "image/png" &&
        this.files[0].type != "image/jpeg" &&
        this.files[0].type != "image/gif"
    ) {
        this.value = ""
        return alert("图片上传格式不正确")
    }
    var imgBox = ".content-img-list"
    var fileList = this.files
        // console.log(fileList.length);
    for (var i = 0; i < fileList.length; i++) {
        var imgSrcI = getObjectURL(fileList[i])
        imgName.push(fileList[i].name)
        imgSrc.push(imgSrcI)
        imgFile.push(fileList[i])
    }
    addNewContent(imgBox)
    this.value = null //上传相同图片
})

//删除
function removeImg(obj, index) {
    imgSrc.splice(index, 1)
    imgFile.splice(index, 1)
    imgName.splice(index, 1)
    var boxId = ".content-img-list"
    addNewContent(boxId)
}

//图片展示
function addNewContent(obj) {
    $(obj).html("")
    for (var a = 0; a < imgSrc.length; a++) {
        var oldBox = $(obj).html()
        $(obj).html(
            oldBox +
            '<li class="content-img-list-item"><img src="' +
            imgSrc[a] +
            '" alt="">' +
            '<div class="hide"><a index="' +
            a +
            '"class="delete-btn"><i class="iconfont icon-lajitong"></i></a>'
        )
    }
}

//建立可存取到file的url
function getObjectURL(file) {
    var url = null
    if (window.createObjectURL != undefined) {
        // basic
        url = window.createObjectURL(file)
    } else if (window.URL != undefined) {
        // mozilla(firefox)
        url = window.URL.createObjectURL(file)
    } else if (window.webkitURL != undefined) {
        // webkit or chrome
        url = window.webkitURL.createObjectURL(file)
    }
    return url
}

  </script>
<script src="../bootstrap/js/bootstrap.min.js"></script>
</body>
</html>